import book.BookList;
import user.Admin;
import user.NormalUser;
import user.User;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-07-08
 * Time: 18:03
 */
public class Test {
    public static User choose(){
        System.out.println("请输入你的id：");
        Scanner scanner=new Scanner(System.in);
        String id=scanner.nextLine();
        System.out.println("请输入你的身份：1.管理员  2.普通用户");
        int choice=scanner.nextInt();
        if(choice==1){
            return new Admin(id);
        }else{
            return new NormalUser(id);
        }

    }
    public static void main(String[] args) {
        BookList bookList = new BookList();
        User user = choose();
        while(true) {
            int choice=user.menu();
            user.doOperation(choice,bookList);
        }
    }
}
